icontheme: Keep a serial
authorMatthias Clasen <mclasen@redhat.com>
Wed, 22 Apr 2020 17:47:17 +0000 (13:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 22 Apr 2020 19:18:16 +0000 (15:18 -0400)
This will let us identify when we have to re-lookup
icons because they may have changed despite the theme
object being the same.

gtk/gtkicontheme.c
gtk/gtkiconthemeprivate.h

index cce4706c959debd5e9dd03703bf23a408bf5d49f..4cb92350e5d802e700c13b827614a93909466819 100644 (file)
@@ -331,6 +331,8 @@ struct _GtkIconTheme
   GList *dir_mtimes;
 
   gulong theme_changed_idle;
+
+  int serial;
 };
 
 struct _GtkIconThemeClass
@@ -1367,6 +1369,13 @@ blow_themes (GtkIconTheme *self)
   self->unthemed_icons = NULL;
   self->dir_mtimes = NULL;
   self->themes_valid = FALSE;
+  self->serial++;
+}
+
+int
+gtk_icon_theme_get_serial (GtkIconTheme *self)
+{
+  return self->serial;
 }
 
 static void
index 495662d1aac9eb50159dc05c94ef705bde2c2873..44225fb57a3ab60e939ab4e9c6c9484e7646e287 100644 (file)
@@ -41,4 +41,6 @@ void gtk_icon_paintable_snapshot_with_colors (GtkIconPaintable *icon,
                                               const GdkRGBA    *warning_color,
                                               const GdkRGBA    *error_color);
 
+int gtk_icon_theme_get_serial (GtkIconTheme *self);
+
 #endif /* __GTK_ICON_THEME_PRIVATE_H__ */